<template>
  <Mheader />
  <Tab />
  <router-view
    :style="viewStyle"
    v-slot="{Component}"
  >
    <keep-alive>
      <component :is="Component" />
    </keep-alive>
  </router-view>
  <router-view
    v-slot="{Component}"
    :style="viewStyle"
    name="user"
  >
    <transition
      appear
      name="slide"
    >
      <keep-alive>
        <component :is="Component" />
      </keep-alive>
    </transition>
  </router-view>
  <Play />
</template>

<script>
import Header from "./components/header/header";
import Tab from "./components/tab/MainTab";
import Play from "./components/player/play";
import { mapState } from "vuex";
export default {
  components: {
    Mheader: Header,
    Tab,
    Play,
  },
  computed: {
    viewStyle() {
      const bottom = this.playList.length ? "60px" : "0";
      return {
        bottom,
      };
    },
    ...mapState(["playList"]),
  },
};
</script>
<style lang="scss">
</style>
